package com.lmz.project.redis.arithmetic.threadLearn;

public class RunnableTest implements Runnable{
    @Override
    public void run() {
        //输出100以内的偶数
        for (int i = 0; i < 100; i++) {
            if (i % 2 == 0){
                System.out.println(Thread.currentThread().getName()+":\t"+i);
            }
        }
    }


    public static void main(String[] args) {
        RunnableTest runnableTest01 = new RunnableTest();
        Thread t1 = new Thread(runnableTest01);
        t1.setName("线程1");
        t1.start();
        Thread t2 = new Thread(runnableTest01);
        t2.setName("线程2");
        t2.start();
    }
}
